<template>
    <div class="shopping_cart-container">
        
        <van-button type="primary" @click="set">设置Store</van-button>
        <van-button type="primary" @click="get">获取Store</van-button>
        <van-button type="primary" @click="remove">删除Store</van-button>
        <van-button type="primary" @click="getUserinfo">获取Userinfo</van-button>
        <van-button type="primary" @click="removeUserinfo">删除Userinfo</van-button>
        {{info}}
        <br>
        {{userinfo}}

    </div>
</template>

<script>
    import { setStore, getStore, removeStore } from '@/libs/store'
    import { getUserInfo } from '@/api/user'
    import { Button } from "vant";
    export default {
        name: 'ShoppingCart',
        components: {
            [Button.name]: Button
        },
        data() {
            return {
                info: null,
                userinfo: null,
            }
        },
        created() {
        },
        methods: {
            set() {
                setStore({name: 'test', content: {id: 1, name: '张三', age: 18}})
            },
            get() {
                this.info = JSON.stringify(getStore({name: 'test'}))
            },
            remove() {
                removeStore({name: 'test'})
            },
            getUserinfo() {
                this.info = JSON.stringify(getStore({name: 'userinfo'}))
            },
            removeUserinfo() {
                removeStore({name: 'userinfo'})
            },
        }
    }
</script>

<style scoped>

</style>